//
//  Move.cpp
//  phi_four
//
//  Created by Snir Gazit on 3/10/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#include "Move.h"
// General Move

void Move::init(MTGen* eng, Lattice * lat) {
	eng_ = eng;
	lat_ = lat;
	zeroOne_.init(eng, UniRealParams(0, 1));
}
bool Move::accept(double p) {
	if (p > 1)
		return true;
	double draw = zeroOne_.draw();
	if (p > draw)
		return true;
	else
		return false;
}
bool Move::checkMove() {
	int totalBonds;
	return lat_->testConfiguration(totalBonds);
}
